// custom-tab-bar/index.js
 
Component({
    /**
     * 组件的属性列表
     */
    options: {
      // 开启这个才可以修改vant组件里面的样式
      styleIsolation: 'shared'
    },
    properties: {
   
    },
    /**
     * 组件的初始数据
     */
    data: {
      case: 1,
      "list": [
        {
          "case": "1",
          "pagePath": "/pages/index/index",
          "text": "政务大厅",
          "iconPath": "./images/home_active.png",
          "selectedIconPath": "./images/home.png"
        },
        {
          "case": "2",
          "pagePath": "/pages/bmfw/bmfw",
          "text": "便民服务",
          "iconPath": "./images/Serve.png",
          "selectedIconPath": "./images/Serve_active.png"
        },
        {
          "case": "3",
          "pagePath": "/pages/news/news",
          "text": "政府公告",
          "iconPath": "./images/news.png",
          "selectedIconPath": "./images/news_active.png"
        },
        {
          "case": "4",
          "pagePath": "/pages/user/user",
          "text": "我的",
          "iconPath": "./images/user.png",
          "selectedIconPath": "./images/user_active.png"
        }
      ]
    },
   
    /**
     * 组件的方法列表
     */
    methods: {
      // 切换tabbar页面
      onChange(event) {
        wx.switchTab({
          url: this.data.list[event.detail].pagePath,
        })
      }
    }
  })